﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace DDOS.Objects
{
    public class BoundingCircle : BoundingObject
    {
        public BoundingSphere boundingSphere;

        public BoundingCircle(float x, float y, float r)
        {
            boundingSphere = new BoundingSphere(new Vector3(x, y, 0), r);
        }

        public override void Move(float x, float y)
        {
            boundingSphere.Center += new Vector3(x, y, 0);
        }

        public override bool Intersects(BoundingObject other)
        {
            if (other.GetType() == typeof(BoundingCircle))
            {
                return boundingSphere.Intersects(((BoundingCircle)other).boundingSphere);
            }
            else if (other.GetType() == typeof(BoundingRectangle))
            {
                return boundingSphere.Intersects(((BoundingRectangle)other).boundingBox);
            }
            return false;
        }

        public override string ToString()
        {
            return boundingSphere.ToString();
        }
    }
}
